<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body{
      background: 0 -100px repeat-x url(https://mdn.mozillademos.org/files/5415/bg_gallery.png) #4F191A;
    }
    img{
      display: none;
    }
    table{
      margin: 0 auto;
    }
  </style>
  <script>
    function draw() {
      var images = document.images
      for (var i=0; i<images.length; i++) {
        if (images[i].id !== 'frame') {
          var canvas = document.createElement('canvas')
          canvas.setAttribute('width', 132)
          canvas.setAttribute('height', 150)
          var ctx = canvas.getContext('2d')
          images[i].parentNode.insertBefore(canvas, images[i])
          ctx.drawImage(images[i], 20, 20)
          ctx.drawImage(document.getElementById('frame'), 0, 0)
        }
      }
    }
  </script>
</head>
<body onload="draw()">
  <table>
    <tr>
      <td><img src="https://mdn.mozillademos.org/files/5399/gallery_1.jpg"></td>
      <td><img src="https://mdn.mozillademos.org/files/5401/gallery_2.jpg"></td>
      <td><img src="https://mdn.mozillademos.org/files/5403/gallery_3.jpg"></td>
      <td><img src="https://mdn.mozillademos.org/files/5405/gallery_4.jpg"></td>
    </tr>
    <tr>
      <td><img src="https://mdn.mozillademos.org/files/5407/gallery_5.jpg"></td>
      <td><img src="https://mdn.mozillademos.org/files/5409/gallery_6.jpg"></td>
      <td><img src="https://mdn.mozillademos.org/files/5411/gallery_7.jpg"></td>
      <td><img src="https://mdn.mozillademos.org/files/5413/gallery_8.jpg"></td>
    </tr>
  </table>
  <img id="frame" src="https://mdn.mozillademos.org/files/242/Canvas_picture_frame.png" width="132" height="150">
</body>
</html>